/**
 * @author gaoyj on 2018/8/1.
 */
var batchIds = [];
var ids = [];
var myDate = new Date();
var month = myDate.getMonth() + 1;
var day = myDate.getDate();
if (month < 10) {
    month = "0" + month;
}
if (day < 10) {
    day = "0" + day;
}
var _start = formatDateDay(myDate, 4) + " 00:00:00";
var _end = myDate.getFullYear() + '-' + month + '-' + day + " 23:59:59";
$(function () {
    buttonShiro("export_Role");
    $.ajax({
        type: "POST",
        url: "/CardProductController/queryAllCardOperatorList",
        dataType: "json",
        success: function (data) {
            $("#operator").html("");
            var str = "<option value=\"\">全部</option>";
            if (data != null && data.length > 0) {
                for (var i = 0; i < data.length; i++) {
                    str += '<option value=' + data[i].cardOperatorId + '>' + data[i].cardOperatorName + '</option>'
                }
            }
            $("#operator").append(str);
            //缺一不可  
            $('.selectpicker').selectpicker('refresh');
            $('.selectpicker').selectpicker('render');
        },
        beforeSend: function () {
        }
    });
})

function btnshiroCheck() {
    debugger;
    $.ajax({
        type: "GET",
        url: "/adminButton/getBtnShiro",
        dataType: "json",
        success: function (data) {
            console.log(data);
            if (!data.success) {
                alert(1);
                $("#export").hide();
            }
        }
    });
}

function formatDateDay(date, index) {
    date = new Date(date - index * 24 * 60 * 60 * 1000);
    var year = date.getFullYear();
    var month = date.getMonth() + 1;
    var day = date.getDate();
    if (month < 10) {
        month = "0" + month;
    }
    if (day < 10) {
        day = "0" + day;
    }
    return year + "-" + month + "-" + day;
}

$("#buyStartTime").val(_start);
$("#buyEndTime").val(_end);
laydate.render({
    elem: '#buyStartTime',
    type: 'datetime'

});
laydate.render({
    elem: '#buyEndTime'
    , type: 'datetime'
});
getTelecomJudge();
var adminRole = roleCheck();
$('#dataTable').bootstrapTable({
    url: '/CollectCardDetail/queryReceiveList',
    height: $(window).height() - 200,
    pageSize: 100,
    pagination: true,
    pageList: [30, 50, 100],
    clickToSelect: true,
    queryParams: queryParams,
    uniqueId: 'id',
    queryParamsType: '',
    sidePagination: 'server',
    showFooter: true,
    detailView: true,
    detailFormatter: function (index, row) {
        return getLog(row);
    },
    responseHandler: function (res) {
        return {
            "total": res.total,//总页数
            "rows": res.resultList   //数据
        };
    }, onClickRow: function (row) {
        if (row.userAccount != null && row.userAccount != '') {
            $("#account_field" + row.id).html(row.userAccount);
        }
    },
    columns: [[
        {
            checkbox: true,
            align: 'center'
        }, {
            width: '3px',
            align: 'center',
            formatter: function (v, row, index) {
                return index + 1
            }
        },
        {
            field: 'userAccount',
            title: '会员编号/名称',
            width: 90, align: 'center',
            formatter: function (v, o) {
                var userName = o.userName;
                if (userName === undefined || userName === "") {
                    userName = "-";
                }
                return copyAddon(v) + (adminRole == 1 ? v : userAccountHidden(o.userAccount, o.id)) + " </br>" + userName;
            }
        }, {
            field: 'batchId',
            title: '批次号/订单号/茶蛋订单号',
            width: 50,
            align: 'center',
            formatter: function (v, r) {
                return '<span>' + v + '</span>' + '</br><span>' + r.orderId + '</span>' + '</br><span>' + (r.teeEggOrderNo == null ? "" : r.teeEggOrderNo) + '</span>'
            }
        },
        {
            field: 'cardNumber',
            title: '卡号/卡密',
            width: 200, align: 'center',
            formatter: function (v, o) {
                var resultStr = "";
                var num = "'" + o.cardNumber + "'"
                if (o.maintenance == 1) {
                    if (o.cardNumber.length > 0 && o.productType == 3) {
                        resultStr = '<a  style="color: red" href="#" onclick="getTeleComCardStatus(' + num + ')">' + o.cardNumber + '</a>' +
                            '</br><span style="color: red" id="' + o.cardNumber + '"></span>';
                    } else {
                        resultStr = '<span style="color: red">' + o.cardNumber + '</span>'
                    }
                } else {
                    if (o.cardNumber.length > 0 && o.productType == 3) {
                        resultStr = '<a  href="#" onclick="getTeleComCardStatus(' + num + ')">' + o.cardNumber + '</a></br><span style="color: red" id="' + o.cardNumber + '"></span>';
                    } else {
                        resultStr = '<span>' + o.cardNumber + '</span>'
                    }
                }
                if (o.cardPwd != "") {
                    return resultStr + " </br>" + o.cardPwd;
                } else {
                    return resultStr
                }
            }
        },
        {
            field: 'status',
            title: '运营商/状态',
            width: 90, align: 'center',
            formatter: function (v, o) {
                return (o.cardOperatorName == null ? "-" : o.cardOperatorName) + "</br>" + convertStatus(v);
            }
        },
        {
            field: 'productName',
            title: '产品名称',
            width: 50,
            align: 'center'
        },
        {
            field: 'face',
            title: '面 值',
            width: 50,
            align: 'center'
        },
        {
            field: 'judgeFace',
            title: '预判面值',
            width: 60,
            align: 'center',
            formatter: function (v, o) {
                if (v == null) {
                    return "-";
                }
                return v;
            }
        },
        {
            field: 'startTime',
            title: '时 间',
            width: 150,
            align: 'center',
            formatter: function (v, o) {
                return "收卡:" + o.startTime + "<br/>" +
                    "销卡:" + o.endTime + "<br/>" +
                    "失效:" + getEffect(o.effectTime);
            }
        },
        {
            field: 'discount',
            title: '折-扣',
            width: 50,
            align: 'center',
            formatter: function (v, o) {
                if (o.productType > 310) {
                    return "1";
                } else {
                    return v;
                }
            }
        },
        {
            field: 'settlePrice',
            title: '销卡面值',
            width: 60,
            align: 'center', formatter: function (v, o) {
                if (o.productType > 310) {
                    return o.equitySettlePrice;
                } else {
                    return v;
                }
            }
        },
        {
            field: 'userPrice',
            title: '结算金额',
            width: 60,
            align: 'center',
            formatter: function (v, o) {
                if (o.productType > 310) {
                    if (o.status != 1) {
                        return "0";
                    } else {
                        return o.equityUserPrice;
                    }
                } else {
                    return v;
                }
            }
        },
        {
            field: 'area',
            title: '地区',
            width: 40,
            align: 'center'
        }, {
            field: 'orderSource',
            title: '订单来源',
            width: 40,
            align: 'center'
        }, {
            field: 'mobileNo',
            title: '手机号码',
            width: 40,
            align: 'center'
        }, {
            field: 'added',
            title: '补结算',
            width: 40,
            align: 'center',
            formatter: function (v, o) {
                if (v == 1) {
                    return "是"
                } else {
                    return "否"
                }
            }
        },
        {
            field: 'failReason',
            title: '失败原因',
            width: 100,
            align: 'center',
            formatter: function (v, o) {
                if ((/^[0-9]+$/.test(v))) {
                    return _getCardFailReason(v);
                } else {
                    return v;
                }
            }
        },
        {
            field: 'remark',
            title: '运营备注',
            width: 100,
            align: 'center', formatter: function (v, o) {
                var failReasonChange = "";
                if ((/^[0-9]+$/.test(o.failReason)) && (o.failReason === "17012" || o.failReason === "23002")) {
                    failReasonChange = (o.failReason === "23002") ? "卡密码失效<br/>" : "该卡密已经在系统成功过<br/>";
                }
                return failReasonChange + (v == null ? '' : v);
            }
        }
    ]]
});
$("#search").click(function () {
    var timeAdd = new Date($("#buyStartTime").val());
    var timeEnd = new Date($("#buyEndTime").val());
    if (timeAdd > timeEnd) {
        layer.msg("开始时间不能大于结束时间");
        return false;
    }
    var require = (timeEnd - timeAdd) / (1 * 24 * 60 * 60 * 1000);
    if (require > 7) {
        layer.msg("时间间隔不能超过7天");
        return;
    }
    $("#dataTable").bootstrapTable("refresh");
});

function getEffect(value) {
    return value.substring(0, 4) + "-" + value.substring(4, 6) + "-" + value.substring(6, 8) + " " + value.substring(8, 10) + ":" + value.substring(10, 12) + ":" + value.substring(12, 14)
}

//操作日志
function getLog(row) {
    if (row.picUrl == null || row.picUrl == "" || row.picUrl == 'undefined') {
        return;
    }
    var str = "<div class='ticket-detail-area'>" +
        "<img data-id='" + row.id + "' data-field='"
        + (row.orderId === null ? "" : row.orderId)
        + "' onclick=watchDetail(this,'" + row.orderId + "') src='"
        + row.picUrl + "' onerror=\"this.src='/images/default.png'\"/>";
    return str;
}

function watchDetail(obj, flowNo) {
    var src = $(obj).attr("src");
    var orderId = $(obj).attr("data-field");
    $.dialog({
        title: '卡券图片',
        content: '<input hidden value="' + flowNo
            + '" id="ticketFlowNoForSan"/><br/><img src="' + src + '"/>',
    });
}

//同步
$("#synchronous").click(function () {
    batchIds = [];
    ids = [];
    var rows = $('#dataTable').bootstrapTable("getSelections");
    if (rows == null || rows.length === 0) {
        layer.msg("请选择要操作的数据");
        return;
    }
    for (var i = 0; i < rows.length; i++) {
        batchIds.push(rows[i].batchId);
        ids.push(rows[i].id);
    }
    $.confirm({
        title: '确认!',
        content: '确定同步？',
        confirm: function () {
            $.ajax({
                type: "POST",
                url: "/CollectCardDetail/synchronousCard",
                traditional: true,
                data: {
                    ids: ids
                },
                dataType: "json",
                success: function (data) {
                    if (data.success) {
                        $("#dataTable").bootstrapTable("refresh");
                        layer.msg(data.message);
                    } else {
                        layer.msg(data.message)
                    }
                },
                beforeSend: function () {
                }
            });
        },
        cancel: function () {

        }
    });
})
$("#autoAsyn").click(
    function () {
        var rows = $('#dataTable').bootstrapTable("getSelections");
        if (rows == null || rows.length === 0) {
            layer.msg("请选择要操作的数据");
            return;
        }
        var row = rows[0];
        $.confirm({
            title: '确认!',
            content: '确定手动异步' + row.cardNumber + '吗？',
            confirm: function () {
                $.post("/CollectCardDetail/orderAsyn?orderId="
                    + row.orderId, function (data) {
                    layer.msg(data.message);
                });
            },
            cancel: function () {

            }
        });
    });

//会员备注保存
$("#toSaveRemark").click(function () {
    var remark = $('#remarks').val();
    if (remark == null || remark == "") {
        layer.msg("备注不能为空!");
        return;
    }
    var remarkType = $('#remarkType').val();
    var remarkLimit = $('#remarkLimit').val();
    if (remarkLimit != null && remarkLimit != '' && (remarkLimit.length + remark.length) > 250) {
        layer.msg("备注超长！");
        return;
    }

    $.ajax({
        type: "POST",
        url: "/CollectCardDetail/setRemark",
        data: {
            id: $('#rowId').val(),
            remark: remark,
            remarkType: remarkType
        },
        success: function (data) {
            if (data.success) {
                if (remarkType == "userAndAdminRemark") {

                }
                $("#dataTable").bootstrapTable("refresh");
                layer.msg(data.message);
                $("#myModal1").modal("hide");
            } else {
                layer.msg(data.message)
            }
        },
    });
})

//下载
$("#export").click(function () {
    var timeAdd = new Date($("#buyStartTime").val());
    var timeEnd = new Date($("#buyEndTime").val());
    var require = (timeEnd - timeAdd) / (1 * 24 * 60 * 60 * 1000);
    if (require > 1) {
        layer.msg("只能下载一天的数据");
        return;
    }
    window.location.href = "/CollectCardDetail/downLoad?" + $("#buyCode").serialize()
})

//备注保存：批次失败，卡号失败
$("#toSaveRemark_3").click(function () {
    var remark = $('#remarks_3').val();
    if (remark == null || remark == "") {
        layer.msg("备注不能为空!");
        return;
    }
    if (remark.length > 250) {
        layer.msg("备注超长！");
        return;
    }
    $.confirm({
        title: '确认!',
        content: '备注原因将同步给会员，请确认！',
        confirm: function () {
            $.ajax({
                type: "POST",
                url: "/CollectCardDetail/setFail",
                traditional: true,
                data: {
                    batchId: $('#batchId_3').val(),
                    operate: $('#operate_3').val(),
                    id: $('#id_3').val(),
                    productType: $('#productType_3').val(),
                    remark: remark
                },
                dataType: "json",
                success: function (data) {
                    if (data.success) {
                        $("#dataTable").bootstrapTable("refresh");
                        layer.msg(data.message);
                        $("#myModal3").modal("hide");
                    } else {
                        layer.msg(data.message)
                    }
                },
                beforeSend: function () {
                }
            });
        },
        cancel: function () {

        }
    });
})

function queryParams(params) {
    var statusStr = $("#status").val();
    if (statusStr != null) {
        statusStr = $("#status").val().join(',');
    }
    console.log("orderSource",$("#cardSource"));
    return {
        productType: $('#operator').val(),
        cardNumber: $.trim($('#cardNumber').val()),
        userAccount: $.trim($('#userAccount').val()),
        page: params.pageNumber,
        size: params.pageSize,
        startTime: $("#buyStartTime").val(),
        endTime: $("#buyEndTime").val(),
        batchId: $.trim($("#batch").val()),
        statusStr: statusStr,
        orderId: $.trim($("#orderId").val()),
        face: $.trim($("#face").val()),
        agentNo: $.trim($("#agentNo").val()),
        cardSource: $.trim($("#cardSource").val()),
        timeType: $("#timeType").val(),
        teeEggOrderNo: $.trim($("#teeEggOrderNo").val()),
        transferMark: $("#transferMark").val(),
        remark: $("#remark_query").val()
    };
}

//批次失败 卡号失败 批次再次提交
function failFun(v) {
    var batchIds = [];
    ids = [];
    var rows = $('#dataTable').bootstrapTable("getSelections");
    if (rows == null || rows.length === 0) {
        layer.msg("请选择要操作的数据");
        return;
    }
    //校验运营商类型
    var statusFlag = false;
    for (var i = 0; i < rows.length; i++) {
        //校验运营商类型
        if (i > 0 && rows[i].productType != rows[i - 1].productType) {
            layer.msg("请选择相同运营商操所");
            return;
        }
        //订单状态处理
        if (i > 0 && rows[i].status != rows[i - 1].status) {
            layer.msg("请操作相同状态的订单");
            return;
        }
        batchIds.push(rows[i].batchId);
        ids.push(rows[i].id);
    }

    var title = "";
    switch (v) {
        case 1:
            title = "批次失败";
            ids = [];
            break;
        case 2:
            title = "卡号失败";
            batchIds = [];
            break;
        case 3:
            title = "批次再次提交";
            break;
    }

    //等待慢速试充，传失败原因
    if (rows[0].status == 7 && v != 3) {
        waitSlowTrySellFunc(batchIds, v, ids, rows[0].productType);
        return;
    }

    $.confirm({
        title: '确认!',
        content: '确定' + title + "？",
        confirm: function () {
            $.ajax({
                type: "POST",
                url: "/CollectCardDetail/setFail",
                traditional: true,
                data: {
                    batchId: batchIds,
                    operate: v,
                    id: ids,
                    productType: rows[0].productType
                },
                dataType: "json",
                success: function (data) {
                    if (data.success) {
                        $("#dataTable").bootstrapTable("refresh");
                        layer.msg(data.message);
                    } else {
                        layer.msg(data.message)
                    }
                },
                beforeSend: function () {
                }
            });
        },
        cancel: function () {

        }
    });
}

function equityToFail() {
    ids = [];
    var rows = $('#dataTable').bootstrapTable("getSelections");
    if (rows == null || rows.length === 0) {
        layer.msg("请选择要操作的数据");
        return;
    }
    var status = rows[0].status;
    for (var i = 0; i < rows.length; i++) {
        if (rows[i].status != 3 && rows[i].status != 1 && rows[i].status != 10 && rows[i].status != 9 && rows[i].status != 0) {
            layer.msg("仅在售、可售、已售、待结算、纠纷中订单可以置失败");
            return
        }
        if (rows[i].status != status) {
            layer.msg("不可操作不同状态的订单");
            return
        }
        ids.push(rows[i].id);
    }
    $("#remark").val("");
    $("#remark_id").val("");
    $("#updateUserCertificateModal").modal("show");
}

function equitySetFail() {
    ids = [];
    var rows = $('#dataTable').bootstrapTable("getSelections");
    if (rows == null || rows.length === 0) {
        layer.msg("请选择要操作的数据");
        return;
    }
    var status = rows[0].status;
    for (var i = 0; i < rows.length; i++) {
        if (rows[i].productType <= 310) {
            layer.msg("仅操作权益订单");
            return
        }
        if (rows[i].status != 3 && rows[i].status != 1 && rows[i].status != 10 && rows[i].status != 9 && rows[i].status != 0) {
            layer.msg("仅在售、可售、已售、待结算、纠纷中订单可以置失败");
            return
        }
        if (rows[i].status != status) {
            layer.msg("成功订单不可与其他状态订单同时操作");
            return
        }
        ids.push(rows[i].id);
    }
    var url;
    if (status == 3 || status == 10 || status == 9 || status == 0) {
        url = "/CollectCardDetail/equitySetFail";
    } else if (status == 1) {
        url = "/CollectCardDetail/equitySuccessToFail";
    }
    var remark = $("#remark").val();
    if ($("#remark_id").val() != "") {
        remark = $("#remark_id").val();
    }
    $.confirm({
        title: '确认!',
        content: '确定将这些订单置失败吗？',
        confirm: function () {
            $.ajax({
                type: "POST",
                url: url,
                traditional: true,
                data: {
                    ids: ids,
                    remark: remark,
                },
                dataType: "json",
                success: function (data) {
                    if (data.success) {
                        $("#dataTable").bootstrapTable("refresh");
                        $("#updateUserCertificateModal").modal("hide");
                        layer.msg(data.message);
                    } else {
                        $("#updateUserCertificateModal").modal("hide");
                        layer.msg(data.message)
                    }
                },
                beforeSend: function () {
                }
            });
        },
        cancel: function () {

        }
    });
}

function equitySetSuccess() {
    ids = [];
    var rows = $('#dataTable').bootstrapTable("getSelections");
    if (rows == null || rows.length === 0) {
        layer.msg("请选择要操作的数据");
        return;
    }
    var status = rows[0].status;
    for (var i = 0; i < rows.length; i++) {
        if (rows[i].productType <= 310) {
            layer.msg("仅可操作权益订单");
            return
        }
        if (rows[i].status != 0 && rows[i].status != 9 && rows[i].status != 10) {
            layer.msg("仅在售、待结算、纠纷中订单可以置成功");
            return
        }
        if (rows[i].status != status) {
            layer.msg("不可操作不同状态的订单");
            return
        }
        ids.push(rows[i].id);
    }
    $.confirm({
        title: '确认!',
        content: '确定将这些订单置成功吗？',
        confirm: function () {
            $.ajax({
                type: "POST",
                url: "/CollectCardDetail/equitySetSuccess",
                traditional: true,
                data: {
                    ids: ids
                },
                dataType: "json",
                success: function (data) {
                    if (data.success) {
                        $("#dataTable").bootstrapTable("refresh");
                        layer.msg(data.message);
                    } else {
                        layer.msg(data.message)
                    }
                },
                beforeSend: function () {
                }
            });
        },
        cancel: function () {

        }
    });
}

//等待慢速试充处理
function waitSlowTrySellFunc(batchIds, v, ids, productType) {
    $("#remarks_3").val("");
    $("#batchId_3").val(batchIds);
    $("#operate_3").val(v);
    $("#id_3").val(ids);
    $("#productType_3").val(productType);
    $("#myModal3").modal("show");
}

//设置会员备注
function equitySetRemark(remarkType) {
    var rows = $('#dataTable').bootstrapTable("getSelections");
    if (rows === null || rows.length === 0) {
        layer.msg("请选择要操作的订单");
        return;
    }
    if (rows.length > 1 && remarkType != "userAndAdminRemark") {
        layer.msg("仅允许单笔操作，请确认！");
        return;
    }
    $("#remarkLimit").val(rows[0].remark);
    $("#rowId").val(rows[0].id);
    $("#remarks").val("");
    $('#remarkType').val(remarkType);
    $("#myModal1").modal("show");
}

function getTeleComCardStatus(cardId) {
    var ret = "未知   ";
    var url = '/CollectCardDetail/getTeleComCardStatus?cardId=' + cardId
    console.log(url)
    $.ajax({
        url: url,
        cache: false,
        async: false,
        type: "GET",
        dataType: 'text',
        success: function (status) {
            ret = status;
        },
        error: function (xhr) {
            alert('错误\n\n' + xhr.responseText)
        }
    });
    $("#" + cardId).html(ret)
}

//停止/开启电信预判异常直接走试充
$('#changeTelecomJudge').click(function (e) {
    var status;
    e.stopPropagation();
    var remind = "";
    var isOn = $('#include2').prop('checked');
    if (isOn) {
        remind = "异常n次走试充";
        status = 0
    } else {
        remind = "直接走试充"
        status = 1
    }
    $.confirm({
        title: '确认!',
        content: '确定要' + remind + '吗？',
        confirm: function () {
            $.ajax({
                type: "POST",
                url: "/CollectCardDetail/changeTelecomJudge",
                data: {
                    status: status
                },
                dataType: "json",
                success: function (data) {
                    if (data.success) {
                        layer.msg(data.message);
                        getTelecomJudge();
                    } else {
                        layer.msg(data.message);
                        getTelecomJudge();
                    }
                }
            })
        }
    })
})

function getTelecomJudge() {
    $.ajax({
        type: "POST",
        url: "/CollectCardDetail/getTelecomJudge",
        success: function (data) {
            if (data) {
                $('#include2').bootstrapToggle('on');
            } else {
                $('#include2').bootstrapToggle('off');
            }
        }
    });
}

//手动补结算
function manualClearing() {
    var rows = $('#dataTable').bootstrapTable("getSelections");
    if (rows === null || rows.length === 0) {
        layer.msg("请选择要操作的订单");
        return;
    }
    if (rows.length > 1) {
        layer.msg("仅允许单笔操作，请确认！");
        return;
    }
    if (rows[0].status != 1 && rows[0].status != 2) {
        layer.msg("仅允许操作成功，失败的订单！");
        return;
    }
    $("#MC_rowId").val(rows[0].id);
    $("#MC_userAccount").val(rows[0].userAccount);
    $("#MC_userName").val(rows[0].userName);
    $("#MC_batchId").val(rows[0].batchId);
    $("#MC_orderId").val(rows[0].orderId);
    $("#MC_userPrice").val(rows[0].equityUserPrice);
    $("#MC_remarkLimit").val(rows[0].remark);

    $("#MC_status").val(rows[0].status);
    $("#MC_applyType").val('');
    $("#MC_addUserPrice").val('');
    $("#MC_remark").val('');
    $("#myModal2").modal("show");
}

//保存手动补结算金额
$("#toSaveUserPrice").click(function () {
    var applyType = $("input[name='applyType']:checked").val();
    if (applyType == null || applyType == "") {
        layer.msg("请选择申请类型!");
        return;
    }
    var addUserPrice = $('#MC_addUserPrice').val();
    if (addUserPrice == null || addUserPrice == "") {
        layer.msg("加款金额不能为空!");
        return;
    }

    var remark = $('#MC_remark').val();
    if (remark == null || remark == "") {
        layer.msg("请说明加款原因，备注不能为空!");
        return;
    }
    var remarkLimit = $('#MC_remarkLimit').val();
    if ((remarkLimit.length + remark.length) > 250) {
        layer.msg("输入备注超长!");
        return;
    }
    $.confirm({
        title: '确认!',
        content: '操作后会自动给用户转账结算，请确认？',
        confirm: function () {
            $.ajax({
                type: "POST",
                url: "/CollectCardDetail/manualClearing",
                data: {
                    id: $('#MC_rowId').val(),
                    applyType: applyType,
                    addUserPrice: addUserPrice,
                    remark: remark,
                    status: $('#MC_status').val()
                },
                success: function (data) {
                    if (data.success) {
                        $("#dataTable").bootstrapTable("refresh");
                        layer.msg(data.message);
                        $("#myModal2").modal("hide");
                    } else {
                        layer.msg(data.message)
                    }
                },
            });
        }
    });

})
